#ifndef _INC_CE_DIRENT_
#define _INC_CE_DIRENT_ 1

#define DIRBLKSIZ	512		/* size of directory block */
#define MAXNAMLEN	(512-1)

/* NOTE:  MAXNAMLEN must be one less than a multiple of 4 */

struct direct		    /* data from readdir() */
{
  long	d_ino;		    /* inode number of entry */
  unsigned short d_reclen;  /* length of this record */
  unsigned short d_namlen;  /* length of string in d_name */
  char d_name[MAXNAMLEN+1]; /* name of file */
};

typedef struct
{
  int	 d_fd;			/* file descriptor */
  int	 d_loc;			/* offset in block */
  int	 d_size;		/* amount of valid data */
  char	 d_buf[DIRBLKSIZ];	/* directory block */
  void * d_handle;		// Find handle
  int    d_isfat;		// Is it FAT?
  char   d_path[256];		// dir path
} DIR;			        /* stream data from opendir() */

#ifdef __cplusplus
extern "C" {
#endif

DIR * opendir(char * fname);
void closedir(DIR * dirp);
struct direct * readdir (DIR * dirp);

#ifdef __cplusplus
};
#endif

#endif
